<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wb="http://open.weibo.com/wb">
<head>
<title>综合搜索页面</title>
<script>
		$(document).ready(function() {
			$("#initSearchIndex").addClass("active");
		});
</script>
</head>

<body>
	<h1 align="center">综合搜索页面</h1>
	<c:if test="${not empty message}">
		<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
	</c:if>
	
<form class="form-search" action="queryProductionIndexList"  method="post">
	<div class="row">
		<div class="offset4">
				<c:set var="cityCode1" value="${cityCode}"></c:set>
			 	<label>城市：</label> 
			 		<select id="cityCode" name="cityCode" style="width: 100px">
						<c:forEach var="city" items="${citys}">
							<option value='<c:out value="${city.id}"/>'
								<c:if test="${city.id==cityCode1}">selected</c:if> 
							><c:out value="${city.name}"/></option>
						</c:forEach>
					</select>
			    <label>页数：</label> <input type="text" name="start" class="input-small" value="${pageIndex}" placeholder="请输入数字">
				<label>每页数量：</label> <input id="limit", name="limit" class="input-small"  value="${pageSize}" placeholder="请输入数字"/>
				<label>搜索：</label> <input id="word", name="word" class="input-small"  value="${word}"/>
	    </div>
	</div>	
	<div class="row">
		<label style="padding-left: 20px;">排序字段 :
		<c:set var="sortfieldCode" value="${sortfield}"></c:set>
			<select id="sortfield" name="sortfield">
				<option value="0" <c:if test="${sortfieldCode==0}">selected</c:if>>默认排序 </option>
				<option value="id" <c:if test="${sortfieldCode=='id'}">selected</c:if>>ID</option>
				<option value="currentPrice" <c:if test="${sortfieldCode=='currentPrice'}">selected</c:if>>单价</option>
			</select>
		</label>
		<label style="padding-left: 20px;">规则：
			<c:set var="sortCode" value="${sort}"></c:set>
					<select id="sort" name="sort">
						<option value="0" <c:if test="${sortCode==0}">selected</c:if>>升序</option>
						<option value="1" <c:if test="${sortCode==1}">selected</c:if>>降序</option>
					</select>
			</label>
		</div>
		<div class="row">	
			<label style="padding-left: 20px;">高&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;亮：
					<c:set var="ifHighligetCode" value="${ifHighliget}"></c:set>
					<select id="ifHighliget" name="ifHighliget">   
						<option value="0" <c:if test="${ifHighligetCode==0}">selected</c:if>>不高亮</option>
						<option value="1" <c:if test="${ifHighligetCode==1}">selected</c:if>>高亮</option>
					</select>
			</label>
			<label style="padding-left: 20px;">分类： 
				<c:set var="assortCode" value="${assort}"></c:set>
				<select id="assort" name="assort">   
					<option value="0" >无分类</option>
					<c:forEach var="assort" items="${assorts}">
						<option value='<c:out value="${assort.id}"/>'
							<c:if test="${assort.id==assortCode}">selected</c:if> 
						><c:out value="${assort.name}"/></option>
					</c:forEach>
				</select>
			</label>
	</div>
	<div class="row" align="center">
		<label>
		  <button type="submit" class="btn btn-primary " id="search_btn">查询</button>
		</label>
	</div>	  
	
	<div class="row">
		<label style="padding-left: 20px;">切分后关键字:
			<c:forEach var="word" items="${anaylzerWords}">   
						<b>${word}</b>
			</c:forEach>  
		</label> 
		<label style="padding-left: 20px;">
			总数:<b>${totalsize}</b>
		</label>
	</div>		
	<div class="row">
		<label style="padding-left: 20px;">排序字段 :
			<c:forEach var="word" items="${anaylzerWords}">   
				<b>${word}</b>
			</c:forEach>  
		</label>
		<label style="padding-left: 20px;">
			查询的结果总数:<b>${totalsize}</b>
		</label>
	</div>		
</form>		
	<table class="table table-striped table-bordered table-condensed">
		<thead>
		<tr>
			<th>产品ID</th>
			<th>名称</th>
			<th>全名称</th>
			<th>分类</th>
			<th>分类层次</th>
			<th>单价</th>
			<th>商家ID</th>
			<th>商家名称</th>
			<th>商家地址</th>
			<th>商圈</th>
			<th>得分</th>
		</tr>
		</thead>
		<tbody>
			<c:forEach var="pro" items="${proList}" begin="0" varStatus="i" step="1">
				<tr>
					<td>${pro.id}&nbsp;</td>
					<td>${pro.name}&nbsp;</td>
					<td>${pro.fullName}&nbsp;</td>
					<td>${pro.assort}&nbsp;</td>
					<td>${pro.assortLevel}&nbsp;</td>
					<td>${pro.currentPrice}</td>
					<td>${pro.orgnizationId}</td>   
					<td>${pro.orgnization}</td>
					<td>${pro.address}</td>
					<td>${pro.areas}</td>
					<td>${pro.score}</td>
				</tr>
			</c:forEach>
		</tbody>		
	</table>
</body>
</html>